package com.sgu6.sgu6_machine.dto;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;

public class AppUpdateDto {

    /**
     * list : [{"id":"eb0f5a116e6042a3b74309fed5ce0fbd","createTime":1568191290000,"name":"app-old-1.0.14.apk","version":"1.0.14","content":"修改后台发指令不返回，修改碾米过程缺谷退款问题","remarks":"旧版本协议"}]
     * total : 1
     */

    private int total;
    private ArrayList<AppDto> list;

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public ArrayList<AppDto> getAppList() {
        return list;
    }

    public void setAppList(ArrayList<AppDto> list) {
        this.list = list;
    }

    public static class AppDto implements Parcelable {
        /**
         * id : eb0f5a116e6042a3b74309fed5ce0fbd
         * createTime : 1568191290000
         * name : app-old-1.0.14.apk
         * version : 1.0.14
         * content : 修改后台发指令不返回，修改碾米过程缺谷退款问题
         * remarks : 旧版本协议
         */

        private String id;
        private long createTime;
        private String name;
        private String version;
        private String content;
        private String remarks;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public long getCreateTime() {
            return createTime;
        }

        public void setCreateTime(long createTime) {
            this.createTime = createTime;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getVersion() {
            return version;
        }

        public void setVersion(String version) {
            this.version = version;
        }

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public String getRemarks() {
            return remarks;
        }

        public void setRemarks(String remarks) {
            this.remarks = remarks;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeLong(this.createTime);
            dest.writeString(this.name);
            dest.writeString(this.version);
            dest.writeString(this.content);
            dest.writeString(this.remarks);
        }

        public AppDto() {
        }

        private AppDto(Parcel in) {
            this.id = in.readString();
            this.createTime = in.readLong();
            this.name = in.readString();
            this.version = in.readString();
            this.content = in.readString();
            this.remarks = in.readString();
        }

        public static final Parcelable.Creator<AppDto> CREATOR = new Parcelable.Creator<AppDto>() {
            public AppDto createFromParcel(Parcel source) {
                return new AppDto(source);
            }

            public AppDto[] newArray(int size) {
                return new AppDto[size];
            }
        };
    }
}
